#define _CRT_SECURE_NO_WARNINGS	

#include <stdio.h>
#include<string.h>
#include<ctype.h>

const int MAX = 1010;
char str[MAX];

int main()
{
    fgets(str, MAX, stdin);
    char* ps = str;
    int len = strlen(str);
    if (str[len - 1] == '\n')
    {
        str[len - 1] = '\0';
        len--;
    }
    int letter = 0, space = 0, digit = 0, other = 0;
    while (*ps != '\0')
    {
        if (isdigit(*ps))
            digit++;
        else if (isspace(*ps))
            space++;
        else if (isalpha(*ps))
            letter++;
        else
            other++;
        ps++;
    }
    printf("%d\n%d\n%d\n%d\n", letter, space, digit, other);
    return 0;
}